package lab03.test03;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by Administrator on 2017/11/16.
 */
public class Text02 {
    //   用字节流读文件。
    public static void main(String[] args) {
        String path="E:\\text.txt";

        try {

            FileInputStream fileInputStream=new FileInputStream(path);
            int tmp;

          while( (tmp= fileInputStream.read())!=-1)
          {
              System.out.println((char) tmp);
          }

        } catch (FileNotFoundException e) {
            e.printStackTrace();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
